using UnityEngine;

public class PlayerDeadState : PlayerState
{
    private Ui ui;

    public PlayerDeadState(Player player, string animBoolName) : base(player, animBoolName)
    {
        ui = Object.FindAnyObjectByType<Ui>();
    }

    public override void Enter()
    {
        base.Enter();
        GameManager.Instance.playerLastPosition = player.transform.position;
        ui.ShowFadeScreen();
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void Update()
    {
        base.Update();
        player.SetVelocityToZero();
    }
}
